@extends('default.layouts.vice_head_foot')
@section('title'){{$job_search.Site::get('area_name').'找工作|最新招聘信息|'.Site::get('webname')}} @endsection
@section('insert_css')
    {{--添加样式表--}}
    <link rel="stylesheet" href="{{asset('/default/css/index/vice_public.css')}}">
    <link rel="stylesheet" href="{{asset('/default/css/index/job.css')}}">
    <link rel="stylesheet" href="{{asset('/default/css/index/station.css')}}">
@endsection
@section('content')
    {{--副页菜单模版--}}
    @include('default.layouts.index_vice_mune')
    {{--分站列表--}}
    @include('default.layouts.station')
    {{--内容区显示区--}}
    <div class="vicecontent">
        {{--阴影线--}}
        <div class="shadow_line"></div>
        <div class="content_area">
            {{--搜索--}}
            <div class="search">
                <form action="{{url('job')}}" method="post" name="resumeSearch" id="resumeSearch">
                    {{csrf_field()}}
                    <input type="hidden" value="0" id="keyword_type" name="keyword_type" data-value="0">
                    <input type="hidden" value="0" id="selArea" name="selArea" data-value="1">
                    <input type="hidden" value="{{$map_show}}" id="map_show" name="map_show" >
                    @if(!empty($map_show))
                        <input name="position" id="position" value="{{$mypos}}" type="hidden" />
                    @endif
                    <ul>
                        <li id="keyword_type_select" class="index_select"><span><a>全文</a></span><i></i></li>
                        <li class="text"><input name="keyword" placeholder="请输入职位名称"  type="text"></li>
                        <li class="go"><button type="submit">搜索职位</button></li>
                    </ul>
                </form>
            </div>
            {{--更多搜索功能--}}
            <div class="search2">
                <div class="or">或者</div>
                <div id="selectNavMoreSearch" class="more"><a>更多搜索功能</a><i></i></div>
            </div>
            {{--附近工作--}}
            <div class="job_nearby"><span><a href="{{asset('/job?map_show=1')}}">附近工作</a></span></div>
            @if(!empty($map_show))
                <div class="curr_location">
                    <span class="mylocation">当前位置：</span>
                    <span class="location">{{str_limit($curr_position,14)}}</span>
                    <span class="editlocation"><a id="popupBox">修改位置</a></span>
                </div>
            @endif
            {{--当前访问的位置--}}
            <div class="current_index">当前位置：首页 > 找工作</div>
            {{--用户搜索条件状态显示--}}
            <form name="job_form" id="job_form" method="post" action="{{asset('/post_search/')}}">
            <div class="job_status" id="job_status">
                <div class="currentitle"><b>您已选择：</b></div>
                @if(count($del_list) > 0)
                    @foreach($del_list as $k=>$v)
                        @if($v['text']!='')
                        <div class="label_list">
                            {{$v['text']}}
                            <em><a  href="{{$v['url']}}">&nbsp;</a></em>
                        </div>
                        @endif
                    @endforeach
                @else
                <span class="label_list" style="padding-right: 12px;">不限</span>
                @endif
                <div class="currentitle"><em class="clearall"><a href="{{url('/job/')}}">全部清除</a></em>{{--<em class="addsubscribe">+添加订阅</em>--}}</div>
            </div>
            {{--用户搜索条件状态显示=> 用户工作条件选择显示--}}
            <div class="status_add">
                <span class="label_list">不限</span>
            </div>

            <div id="inputvalue" >{{--class="display_none"--}}</div>

            {{--用户搜索条件状态显示=> 工作条件选择--}}
            <div class="condition_selection">
                    {{csrf_field()}}
                <div id="location">
                    <ul>
                        <li class="li_left">工作地区</li>
                        <li class="li_right" >
                            <div class="left">
                                @if(count($area) > 0)
                                    @foreach($area as $k=>$v)
                                        @if($v['check']==1)
                                            <a href="{{$v['url']}}" class="tocheck">{{$v['text']}}</a>
                                        @else
                                             <a href="{{$v['url']}}" >{{$v['text']}}</a>
                                        @endif
                                    @endforeach
                                @endif
                                <em id="location_tip" class="red"></em>
                            </div>
                            <div class="right">
                                <a href="#" id="areamore"><span>更多</span><em></em></a>
                            </div>
                        </li>
                    </ul>
                </div>
                <div id="temptation">
                    <ul>
                        <li class="li_left">福&nbsp;&nbsp;利</li>
                        <li class="li_right">
                            <div class="left">
                                @if(count($welfare) > 0)
                                    @foreach($welfare as $k=>$v)
                                        @if($v['value']==$input['welfare'])
                                            <a href="{{$v['url']}}" class="tocheck">{{$v['text']}}</a>
                                        @else
                                            <a href="{{$v['url']}}" >{{$v['text']}}</a>
                                        @endif
                                    @endforeach
                                @endif
                                </div>
                            <em id="temptation_tip" class="red"></em>
                        </li>
                    </ul>
                </div>
                <div id="salary">
                    <ul>
                        <li class="li_left">职位月薪</li>
                        <li class="li_right" id="salary">
                            <div class="left">
                            @if(count($salary) > 0)
                                @foreach($salary as $k=>$v)
                                        @if($v['value']==$input['salary'])
                                            <a href="{{$v['url']}}" class="tocheck">{{$v['text']}}</a>
                                        @else
                                            <a href="{{$v['url']}}" >{{$v['text']}}</a>
                                        @endif
                                @endforeach
                            @endif
                            </div>
                            <em id="salary_tip" class="red"></em>
                        </li>
                    </ul>
                </div>
                <div  class="bordernone other_select">
                    <ul>
                        <li class="li_left">其 它</li>
                        <li class="li_right">
                            <p>
                                <input name="jobsort1" type="hidden" id="jobsort1" value="{{$input['jobsort1'] or ''}}">
                                <input name="jobsort2" type="hidden" id="jobsort2" value="{{$input['jobsort2'] or ''}}">
                                <input name="jobsort3" type="hidden" id="jobsort3" value="{{$input['jobsort3'] or ''}}">
                                <input name="jobsort4" type="hidden" id="jobsort4" value="{{$input['jobsort4'] or ''}}">
                                <input name="jobsort5" type="hidden" id="jobsort5" value="{{$input['jobsort5'] or ''}}">
                                <input name="jobarea1" type="hidden" id="jobarea1" value="{{$input['jobarea1'] or ''}}">
                                <input name="jobarea2" type="hidden" id="jobarea2" value="{{$input['jobarea2'] or ''}}">
                                <input name="jobarea3" type="hidden" id="jobarea3" value="{{$input['jobarea3'] or ''}}">
                                <input name="jobarea4" type="hidden" id="jobarea4" value="{{$input['jobarea4'] or ''}}">
                                <input name="jobarea5" type="hidden" id="jobarea5" value="{{$input['jobarea5'] or ''}}">
                                <span class="jList" id="jobsortmore">
                                    <input type="text" name="jobsort" id="jobsort" value="{{$cninput['jobsort'] or ''}}" readonly style="cursor: text" placeholder="工作岗位不限" aria-invalid="false" class="valid">
                                    <i></i>
                                </span>
                            </p>
                            <p>
                                <input name="industry1" type="hidden" id="industry1" value="{{$input['industry1'] or ''}}">
                                <input name="industry2" type="hidden" id="industry2" value="{{$input['industry2'] or ''}}">
                                <input name="industry3" type="hidden" id="industry3" value="{{$input['industry3'] or ''}}">
                                <input name="industry4" type="hidden" id="industry4" value="{{$input['industry4'] or ''}}">
                                <input name="industry5" type="hidden" id="industry5" value="{{$input['industry5'] or ''}}">
                                <span class="jList" id="industrymore">
                                    <input type="text" name="industry" id="industry" value="{{$cninput['industry'] or ''}}" readonly style="cursor: text"
                                           placeholder="行业不限"/>
                                    <i></i>
                                </span>

                            </p>
                            <p>
                                <input id="work_year" name="work_year" type="hidden" value="{{$input['work_year'] or ''}}">
                                <span id="work_year_select" class="select"><span><a></a></span><i></i></span>
                            </p>
                            <p>
                                <input id="education" name="education" type="hidden" value="{{$input['education'] or ''}}">
                                <span id="education_select" class="select"><span><a></a></span><i></i></span>
                            </p>
                        </li>
                    </ul>
                </div>
            </div>
            </form>
            <div class="job_display">
                <div class="job_display_left">
                    <div class="head_info">
                        <div class="list1"><i>共有<em>{{ $company_job->total() }}</em>+职位</i></div>
                        <div class="list2">
                            <i><input type="checkbox" id="graduate" name="graduate" @if($input['work_year']=='9')checked @endif><label for="graduate">应届生</label></i>
                            <i><input type="checkbox" name="anxious" id="anxious" @if($input['anxious']!='')checked @endif><label for="anxious"><span></span>急聘</label></i>
                            <i><input type="checkbox" name="brandcompany" id="brandcompany" @if($input['brandcompany']!='')checked @endif><label for="brandcompany">名企</label></i>
                        </div>
                        <div class="list3">
                            @if($company_job->lastPage() == 1 || $company_job->currentPage() == 1)
                                <a><i class="left"></i></a>
                            @else
                                <a href="{{$company_job->previousPageUrl()}}"><i class="left"></i></a>
                            @endif
                            <em>{{$company_job->total()== 0 ? 0 : $company_job->currentPage()}}</em>/{{$company_job->lastPage()}}
                            @if($company_job->lastPage() == 1 || $company_job->currentPage() == $company_job->lastPage())
                                    <a><i class="right"></i></a>
                            @else
                                <a href="{{$company_job->nextPageUrl()}}"><i class="right"></i></a>
                            @endif
                        </div>
                    </div>
                    <div class="middle_info">
                    @if($company_job->count())
                        @foreach ($company_job as $k=>$v)
                            <div class="saith">
                                <ul class="father_ul">
                                    <li>
                                        <ul class="son_ul father_ul1_position">
                                            <li class="list1"><a href="{{url('/jobinfo_'.idEncryption($v->id).'.html')}}" target="_blank">{{ str_limit($v->job_title,22) }}</a>
                                                @if(!empty($v->part_status) && $v->part_status == '2')
                                                    <i class="one"></i>
                                                @elseif(!empty($v->part_status) && $v->part_status == '3')
                                                    <i class="two"></i>
                                                @elseif(!empty($v->part_status) && $v->part_status == '4')
                                                    <i class="three"></i>
                                                @endif
                                                @if($v->urgent==1)<em>急聘</em>@endif</li>
                                            <li class="list2">{{$v->salary_above or ''}}</li>
                                            <li class="list4"><a href="{{url('/comabout_'.idEncryption($v->com_id).'.html')}}" target="_blank">{{str_limit($v->company_name,32)}}</a></li>
                                            @if(!empty($map_show))
                                                <li class="list5"><a  class="mapshow" data-id="{{$v->longitude}},{{$v->latitude}},{{$v->company_name}}"><span>{{$v->juli}}</span><i></i></a></li>
                                            @endif
                                        </ul>
                                    </li>
                                    <li>
                                        <ul class="son_ul">
                                            <li class="list1 son_list2_refont">{{msubstr($v->location,0,12)}}@if(!empty($v->work_year)) {{'/'.$v->work_year}}@endif @if(!empty($v->education)) {{'/'.$v->education}}@endif</li>
                                            <li class="list2 son_list2_refont">{{$v->updatetime or ''}}</li>
                                            <li class="list4 son_list2_refont">{{ str_limit($v->industry,20)}}@if(!empty($v->employee_num)) {{ ' | '.$v->employee_num }}@endif</li>
                                        </ul>
                                    </li>
                                    <li>
                                        <ul class="son_ul welfarespan">
                                            <li class="list">{!! $v->welfare !!} </li>
                                        </ul>
                                    </li>
                                </ul>
                            </div>
                        @endforeach
                    @else
                        <div class="no-one">
                            <img src="{{ asset("/default/images/index/bgpic.jpg") }}">
                            <p>对不起,没有符合条件的记录!</p>
                        </div>
                    @endif
                    </div>
                    {{--分页链接--}}
                    <div class="paging">
                        <div class="page_list">
                          {!! $page !!}
                        </div>
                    </div>
                </div>
                <div class="job_display_right">
                    {{--右上图片--}}
                    <div class="top_img">
                        <a href="{{url('personal/resume_mange')}}"><img src="{{asset('/default/images/index/job_display_right_top.jpg')}}"></a>
                    </div>
                    {{--右下图片+招聘信息--}}
                    <div class="company_info_title">
                        这些公司正在招
                    </div>
                    <div class="company_info">
                        @if(count($recommendedjob) > 0)
                            @foreach($recommendedjob as $k=>$v)
                                <div>
                                    <ul>
                                        <li class="li_left"><a href="{{url('/comabout_'.idEncryption($v->com_id).'.html')}}" target="_blank">{!! $v->logo !!}</a></li>
                                        <li class="li_right">
                                            <ul class="li_right_ul">
                                                <li><a href="{{url('/comabout_'.idEncryption($v->com_id).'.html')}}" target="_blank">{{str_limit($v->company_name,16)}}</a></li>
                                                <li class="font12 darkgray"><a href="{{url('/jobinfo_'.idEncryption($v->id).'.html')}}" target="_blank">{{str_limit($v->job_title,16)}}</a></li>
                                                <li class="font12 gray">{{ $v->salary_above or '' }}</li>
                                            </ul>
                                        </li>
                                    </ul>
                                </div>
                            @endforeach
                        @endif
                    </div>
                </div>
            </div>
        </div> {{--end 内容显示--}}

    </div>
    <div id="moreSearch_option" class="moreSearch">
        <div><i></i></div>
        <ul>
            <li><a href="{{url('/job')}}">最新工作</a></li>
            <li><a href="{{url('/job?map_show=1')}}">附近工作</a></li>
            <li><a href="{{url('/personal/accurate_search')}}">全能搜索</a></li>
            <li><a href="{{asset('personal/recommended_post')}}">推荐的职位</a></li>
        </ul>
    </div>
    {{--浮动层--}}
    {{--@include('default.layouts.floating')--}}
    <!--地图定位DIV遮掩层-->
    <div id="keep_sceen" class="cover"></div>
    <div id="twoKeep_sceen" class="twoCover"></div>
    <div id="mappositoon" class="mappositoon"><span>正在定位中，请稍候...</span></div>
    <!--选择地图定位map-->
    <div id="box_sceen" class="box_sceen">
        <div class="mapcon">
            <div class="mtop">
                <h3>选择位置</h3>
                <span> <a class="determine">确定</a> <a href="javascript:void(0);" class="cancel">取消</a></span> </div>
            <div class="mleft">
                @if(count($place) > 0)
                    @foreach($place as $v)
                        <ul>
                            <li class="title">{{$v['city']}}</li>
                            @if(!empty($v['place']))
                                <li>
                                    @foreach($v['place'] as $vv)
                                        <a ref="{{$vv->longitude}},{{$vv->latitude}},{{$vv->name}}">{{$vv->name}}</a>
                                    @endforeach
                                </li>
                            @endif
                        </ul>
                    @endforeach
                @endif
            </div>
            <div class="mright" id="mapshow"></div>
        </div>
    </div>

    <!--地图公交驾车线路DIV遮掩层-->
    <div id="threeKeep_sceen" class="twoCover" style="height:600px;"></div>
    <div id="threebox_sceen" class="box_sceen threebox">
        <div class="gLine">
            <h3>地图线路</h3>
            <span><a id="close"></a></span> </div>
        <div class="busMap">
            <div class="bLeft" id="mapshow2"></div>
            <div class="bright">
                <ul>
                    <li><a>公交路线</a></li>
                    <li class="g_title" ><a>驾车路线</a></li>
                </ul>
                <div class="bus">
                    <div class="content" id="r-result"></div>
                </div>
                <div class="car">
                    <div class="content" id="l-result"></div>
                </div>
            </div>
        </div>
    </div>
    {{--app下载--}}
    @if( !empty(Site::get('appPersonHasIOS')) || !empty(Site::get('appPersonHasAndroid') ) )
        @include('default.layouts.personalApp')
    @endif
@endsection
@section('footerjs')
    @parent
<script type="text/javascript" src="{{Resources::jsOption('jobsearch')}}"></script>
<script type="text/javascript" src="{{asset('/default/js/index/job.js')}}"></script>
<script type="text/javascript" src="{{asset('/default/js/jquery/jquery.position.js')}}"></script>
<script type="text/javascript" src="{{asset('/default/js/jquery/jquery.calling.js')}}"></script>
<script type="text/javascript" src="{{asset('/default/js/index/index_public.js')}}"></script>
<script type="text/javascript" src="{{asset('/default/js/jquery/jquery.area.js')}}"></script>
<script type="text/javascript" src="{{asset('/default/js/index/app.js')}}"></script>

@if(!empty($map_show))
<script type="text/javascript" src="{{asset('/default/js/index/mapsceen.js')}}"></script>
<script type="text/javascript" src="{{getRequestType()}}://api.map.baidu.com/api?v=2.0&ak={{Site::get('mapKey')}}"></script>
<script>
    var mypos = '{{$mypos}}';
    var set_seesion = '{{$set_seesion}}';
    var _token ='{{csrf_token()}}';
</script>
@endif

<script type="text/javascript">

    var education_url='{!!$optionsurl['education']!!}';
    var work_year_url='{!!$optionsurl['work_year']!!}';
    var jobarea_url='{!!$optionsurl['jobarea']!!}';
    var jobsort_url='{!!$optionsurl['jobsort']!!}';
    var industry_url='{!!$optionsurl['industry']!!}';
    var anxious_url='{!!$optionsurl['anxious']!!}';
    var brandcompany_url='{!!$optionsurl['brandcompany']!!}';

    $(function(){
        $("#areamore"). click(function(){
            workplaceInputGet('');
        });
        $("#jobsortmore"). click(function(){
            posCateInputGet('');
        });

        $("#industrymore"). click(function(){
            callInputGet('');
        });
        //鼠标移动事件
        $(".saith").mouseover(function(){
            $(this).mouseover(function(){
                $(this).addClass("even");
            });
            $(this).mouseout(function(){
                $(this).removeClass("even");
            });
        });
    });

    function workplaceInputGet(randfrm){
        var workarr = {
            objId: '#jobLoc'+randfrm,					//当前显示内容的ID值
            objProvince: 'address_P'+randfrm,	        //当前select省份
            objCity: 'address_C'+randfrm,		        //当前select市区县
            objCate:'#locCate'+randfrm,					//当前页面弹出层显示要追加的工作地区类别内容
            objTwoCate:'#twolocCate'+randfrm,		    //当前页面要追加的工作地区类别内容
            objChcekbox:'#jobLocations'+randfrm,	    //当前弹出层 复选框checkbox的前缀名id值
            objSelect:'locSelect'+randfrm,				//当前弹出层 追加到弹出要追加的内容里面的ID前缀值
            objTwoSelect:'twolocSelect'+randfrm,	    //当前页面  追加到当前页面要追加的内容里面的ID前缀值
            objPostCate:'#workplace',					//当前页面  追加到当前页面input要追加的内容里面的ID前缀值
            objArr : ["#jobarea1"+randfrm,"#jobarea2"+randfrm,"#jobarea3"+randfrm,"#jobarea4"+randfrm,"#jobarea5"+randfrm], //当前隐藏表单
            keep_sceen :'#keep_sceen',					//遮掩层
            objLevel:'3',								//设置当前显示的级别
            objInpaLength:'5',							//设置当前input 表单选项的个数
            callback:function(val,text){
                var urlget='';
                $.each(val,function(k,v){
                    k++;
                    if(v!=''){
                        if(k!=1) urlget+='&';
                        urlget+='jobarea'+k+'='+v;
                    }else{
                        return false;
                    }
                });
                var exl="?";
                if(jobarea_url.indexOf("?") > 0 ){
                    exl='&';
                }
                window.location=jobarea_url+exl+urlget;
            }
        };
        workObj.showextend(randfrm,workarr);
    }


    function posCateInputGet(randfrm,selmod){
        var arrobj = {
            objId: '#jobFun'+randfrm,					        //当前显示内容的ID值
            objCate:'#funCate'+randfrm,					        //当前页面弹出层显示要追加的岗位类别内容
            objTwoCate:'#twofunCate'+randfrm,				    //当前页面要追加的岗位类别内容
            objChcekbox:'#jobFunctions'+randfrm,			    //当前弹出层 复选框checkbox的前缀名id值
            objSearchChcekbox:'#jobFunctionSearch'+randfrm,     //当前弹出层 复选框checkbox的前缀名id值 搜索的复选框
            objSelect:'funSelect'+randfrm,				        //当前弹出层 追加到弹出要追加的内容里面的ID前缀值
            //objTwoSelect:'twofunSelect'+randfrm,			    //当前页面  追加到当前页面要追加的内容里面的ID前缀值
            objPostCate:'#jobsort',                             //当前页面  追加到当前页面input要追加的内容里面的ID前缀值
            objArr : ["#jobsort1"+randfrm,"#jobsort2"+randfrm,"#jobsort3"+randfrm,"#jobsort4"+randfrm,"#jobsort5"+randfrm], //当前隐藏表单
            keep_sceen :'#keep_sceen',					        //遮掩层
            objLevel:'2',								        //设置当前显示的级别
            objType:'1',								        //设置当前显示的类型
            objMod:selmod,                                      //选择模式 当传入值为1时。出现大类不限
            objInpaLength:'5',								    //设置当前input 表单选项的个数
            callback:function(val,text){
                var urlget='';
                $.each(val,function(k,v){
                    k++;
                    if(v!=''){
                        if(k!=1) urlget+='&';
                        urlget+='jobsort'+k+'='+v;
                    }else{
                        return false;
                    }
                });
                var exl="?";
                if(jobsort_url.indexOf("?") > 0 ){
                    exl='&';
                }
                window.location=jobsort_url+exl+urlget;
            }
        };
        cateObj.showextend(randfrm,arrobj);
    }

    function callInputGet(randfrm,type){
        var callarr = {
            objId: '#comcall'+randfrm,					//当前显示内容的ID值
            objCate:'#callCate'+randfrm,					//当前页面弹出层显示要追加的工作地区类别内容
            objTwoCate:'#twocallCate'+randfrm,				//当前页面要追加的工作地区类别内容
            objChcekbox:'#comcallings'+randfrm,			//当前弹出层 复选框checkbox的前缀名id值
            objSelect:'callSelect'+randfrm,				//当前弹出层 追加到弹出要追加的内容里面的ID前缀值
            objTwoSelect:'twocallSelect'+randfrm,			//当前页面  追加到当前页面要追加的内容里面的ID前缀值
            objPostCate:'#industry',                          //当前页面  追加到当前页面input要追加的内容里面的ID前缀值
            objArr : ["#industry1"+randfrm,"#industry2"+randfrm,"#industry3"+randfrm,"#industry4"+randfrm,"#industry5"+randfrm], 	//当前隐藏表单
            keep_sceen :'#keep_sceen',					//遮掩层
            objLevel:'1',								//设置当前显示的级别
            objInpaLength:'5',							//设置当前input 表单选项的个数
            callback:function(val,text){
                var urlget='';
                $.each(val,function(k,v){
                    k++;
                    if(v!=''){
                        if(k!=1) urlget+='&';
                        urlget+='industry'+k+'='+v;
                    }else{
                        return false;
                    }
                });
                var exl="?";
                if(industry_url.indexOf("?") > 0 ){
                    exl='&';
                }
                window.location=industry_url+exl+urlget;
            }
        };
        callObj.showextend(randfrm,callarr);
    }
</script>
@endsection
